#include "PrecompiledHeader.h"
#include "ColorMatrixPPFX.h"

/*--------------------------------------------------------------------------*/

ColorMatrixPPFX::ColorMatrixPPFX() :
	IPostprocess(g_Material->GetMaterial("mat_colormatrix_ppfx"))
{
	this->m_colormatrix = glm::mat4();
//  this->m_colormatrix[0] = glm::vec4(0.3f, 0.3f, 0.3f, 1.0f); // r.wy = a * r.we + b * g.we + c * b.we + d * a.we
//  this->m_colormatrix[1] = glm::vec4(0.0f, 0.0f, 0.0f, 1.0f); // g
//  this->m_colormatrix[2] = glm::vec4(0.0f, 1.0f, 0.0f, 0.0f); // b
//  this->m_colormatrix[3] = glm::vec4(0.0f, 0.0f, 0.0f, 0.0f); // a
}

/*--------------------------------------------------------------------------*/

ColorMatrixPPFX::~ColorMatrixPPFX()
{

}

/*--------------------------------------------------------------------------*/

void ColorMatrixPPFX::UploadParameters()
{
	ROpenGL::SetUniformBufferValue(g_Renderer->GetUniformBuffer(EUbo::Postprocess), EUboPostprocess::Var_0, glm::value_ptr(this->m_colormatrix[0]));
	ROpenGL::SetUniformBufferValue(g_Renderer->GetUniformBuffer(EUbo::Postprocess), EUboPostprocess::Var_1, glm::value_ptr(this->m_colormatrix[1]));
	ROpenGL::SetUniformBufferValue(g_Renderer->GetUniformBuffer(EUbo::Postprocess), EUboPostprocess::Var_2, glm::value_ptr(this->m_colormatrix[2]));
	ROpenGL::SetUniformBufferValue(g_Renderer->GetUniformBuffer(EUbo::Postprocess), EUboPostprocess::Var_3, glm::value_ptr(this->m_colormatrix[3]));
}

/*--------------------------------------------------------------------------*/